<template>
  <el-form-item :label="description.label">
    <el-select
      v-model="value"
      :key="description.key"
      :placeholder="description.placeholder"
      style="width: 100%"
    >
      <el-option
        v-for="item in description.options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
</template>

<script setup lang="ts">
import type { FPSelectDescription } from '@/components/function-parameter/fp-select/index'
import { ref } from 'vue'

const props = defineProps({
  description: {
    type: Object as () => FPSelectDescription,
    required: true
  }
})

const value = ref(props.description?.defaultValue)
</script>

<style scoped lang="scss"></style>
